package com.orm.mybatisplus;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableTransactionManagement(order = 2)  //加上这个后，会先切面切换数据源再切换事务，可以在方法里叠加    @Transactional @DataSource(value = DbUtil.DB_MASTER1) 这样就会先切换数据源再添加事务，不会导致无法切换数据源
@SpringBootApplication
public class SpringbootMybatisPlusDynamicDatasourceApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootMybatisPlusDynamicDatasourceApplication.class, args);
    }

}
